---@class BuffConditionType
BuffConditionType = ClientFight.CreateClass("BuffConditionType")
function BuffConditionType:ctor(id, name)
    self.id = id
    if name == nil then
        local a = 1;
    end
    self.name = name .. "[" .. id .. "]"
end
local map = {}
function BuffConditionType:valueOf(id)
    return map[id]
end
---@return BuffConditionType
local function ADD_VALUE(type, id, name)
    local e = BuffConditionType.New(id, name)
    map[e.id] = e
    BuffConditionType[type] = e
    return e
end
---@param buff FighterBuff
function BuffConditionType:action(buff, conditions, ...)
    if (conditions ~= nil) then
        if conditions[1] ~= nil and conditions[1][1] == nil then
            self:actionImp(buff, conditions, ...)
            return
        end
        for k, params in pairs(conditions) do
            local type = self:valueOf(math.abs(params[1]));
            if (type == nil) then
                logError("Buff condition not found, id: " .. params[1]);
                return false;
            end
            if type.id == 13 then
                local a = ...;

            end
            local result = type:actionImp(buff, params, ...);
            if (params[1] > 0 and not result) then
                return false;
            end
            if (params[1] < 0 and result) then
                return false;
            end
        end
    end
    return true;
end
local t = ADD_VALUE("condition1", 1, "普通攻击")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local skill = parameters[2];
    local skillBean = skill.skill.skillBean
    return skillBean.f_SkillType == SkillTypeEnum.NORMAL_ATTACK
end
t = ADD_VALUE("condition2", 2, "治疗技能")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FightUsingSkill
    local skill = parameters[2];
    local skillBean = skill.skill.skillBean
    return skillBean.f_HurtMethod == SkillDamageTypeEnum.HEAL
end
t = ADD_VALUE("condition3", 3, "目标生命值低于自身")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type Fighter
    local target = parameters[1];
    return buff.source.hp >= target.hp
end
t = ADD_VALUE("condition4", 4, "自身生命值低于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local target = buff.target;
    local maxHp = FighterAttributeManager.getFightAttr(target, FighterAttributeEnum.HP);
    local value = calcRatio(maxHp, conditionParameters[2]);
    return target.hp < value;
end
t = ADD_VALUE("condition5", 5, "触发次数小于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    return buff.triggerTimes >= conditionParameters[2]
end
t = ADD_VALUE("condition6", 6, "叠加层数达到最大")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    return buff.overlay == buff.buffBean.f_MaxReplaceLyer
end
t = ADD_VALUE("condition7", 7, "场上敌人数少于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local target = buff.target
    local others = FighterUtils.getOthersBy(target, true);
    return #others < conditionParameters[2];
end
t = ADD_VALUE("condition8", 8, "触发间隔不少于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local frames = conditionParameters[2] / Global.FIGHT_FRAME;
    return buff.triggerFrame == 0 or buff.triggerFrame + frames < buff.source.fight.frame
end
t = ADD_VALUE("condition9", 9, "攻击技能")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local skill = parameters[2];
    local skillBean = skill.skill.skillBean
    return skillBean.f_HurtMethod ~= SkillDamageTypeEnum.NONE and skillBean.f_HurtMethod ~= SkillDamageTypeEnum.HEAL
end
t = ADD_VALUE("condition10", 10, "能量值比较")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local fighter = conditionParameters[1] == 0 and buff.source or buff.target
    local type = conditionParameters[2];
    local value = conditionParameters[3];
    if type == 0 then
        return fighter.energy >= value;
    elseif type == 1 then
        return fighter.energy > value;
    elseif type == 2 then
        return fighter.energy < value;
    elseif type == 3 then
        return fighter.energy <= value;
    end
    return false;
end
t = ADD_VALUE("condition11", 11, "技能目标生命值低于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local targetFighter = buff.skill.target
    if (targetFighter == nil and parameters[1].__cname == Fighter.__cname) then
        --没有就找触发者
        targetFighter = parameters[1];
    end
    if (targetFighter == nil) then
        return false;
    end
    if (conditionParameters[2] == 1) then
        return 1.00000001 * targetFighter.hp / FighterAttributeManager.getFightAttr(targetFighter, FighterAttributeEnum.HP) >= Utils.toRatio(conditionParameters[3]);
    else
        return 1.00000001 * targetFighter.hp / FighterAttributeManager.getFightAttr(targetFighter, FighterAttributeEnum.HP) <= Utils.toRatio(conditionParameters[3]);
    end
end
t = ADD_VALUE("condition12", 12, "子弹普通攻击")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local skill = parameters[2];
    local skillBean = skill.skill.skillBean;
    return skillBean.f_SkillType == 1 and skillBean.f_BulletTpye == 1;
end
t = ADD_VALUE("condition13", 13, "目标身上有指定特殊效果")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local target = buff.target
    local state = bit.lshift(1, (conditionParameters[2] - 1));
    return FighterStateEnum.is(target.totalState.state, state);
end
t = ADD_VALUE("condition14", 14, "目标处于前后场（基于阵营）")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local fighter = buff.target;
    local x = fighter.position.x
    local center = (Global.FIGHT_INNER_ROUND[1][1] + Global.FIGHT_INNER_ROUND[2][1]) / 2.0;
    SkillRoleMgr.savePathFile(string.format("[%s][CONDITION]条件14 %s的Buff%s 当前位置%s,中心位置%s",
            fighter.fight.frame, fighter.fighterId, buff.modelId, x, center
    ));
    --1=前场 2=后场
    local leftOrRight = conditionParameters[2];
    if (leftOrRight == 1) then
        if (fighter.teamIndex == 0) then
            return x <= center;
        else
            return x >= center;
        end
    elseif (leftOrRight == 2) then
        if (fighter.teamIndex == 0) then
            return x >= center;
        else
            return x <= center;
        end
    else
        return false;
    end
end
t = ADD_VALUE("condition21", 21, "目标是否被控制")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local target = buff.target
    local buffs = BuffManager.getBuffsByControl(target, true);
    local type = conditionParameters[1]
    if (type == 0) then
        return #buffs == 0
    elseif type == 1 then
        return #buffs > 0
    else
        return false;
    end
end
t = ADD_VALUE("condition22", 22, "触发次数（+本次触发）为n的整数倍")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local name = "condition22"
    local times = buff.conditionParameters[name] or 0
    buff.conditionParameters[name] = times
    times = times + 1
    return times % conditionParameters[2] == 0;
end
t = ADD_VALUE("condition23", 23, "触发技能ID")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FightUsingSkill
    local skill = parameters[2];
    if (skill == nil) then
        return false;
    end
    return skill.skill.skillBean.f_SkillID == conditionParameters[2];
end
t = ADD_VALUE("condition24", 24, "暴击判断")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FightResult
    local result = parameters[3];
    return result.state == DamageResultTypeEnum.CRIT
end
t = ADD_VALUE("condition25", 25, "效果目标生命值低于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local targetFighter = buff.target;
    return (0.0 + targetFighter.hp) / FighterAttributeManager.getFightAttr(targetFighter, FighterAttributeEnum.HP) < Utils.toRatio(conditionParameters[2]);
end
t = ADD_VALUE("condition26", 26, "是否召唤物")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local fighter = nil;
    if (conditionParameters[2] == 1) then
        fighter = buff.target
    elseif (conditionParameters[2] == 2) then
        fighter = parameters[1];
    else
        return false;
    end
    if (conditionParameters[1] > 0) then
        return fighter:isRealSummons();
    else
        return fighter.summons
    end
end
t = ADD_VALUE("condition27", 27, "闪避判断")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FightResult
    local result = parameters[3]
    return result.state == DamageResultTypeEnum.DODGE
end
t = ADD_VALUE("condition28", 28, "单次伤害大于等于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local fighter = buff.target
    ---@type FightResult
    local result = parameters[3];
    return (0.0 + result.damage) / FighterAttributeManager.getFightAttr(fighter, FighterAttributeEnum.HP) >= Utils.toRatio(conditionParameters[2]);
end
t = ADD_VALUE("condition29", 29, "触发buff类型")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FighterBuff
    local triggerBuff = parameters[1]
    if (conditionParameters[2] == triggerBuff.buffBean.f_BuffType) then
        return true;
    end
    if (conditionParameters[2] == 3) then
        -- // 控制效果
        if (table.contains(triggerBuff.buffBean.f_Control, 1)) then
            return true;
        end
    end
    return false;
end
t = ADD_VALUE("condition30", 30, "触发者为buff来源")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type Fighter
    local trigger;
    if not parameters[1] then
        return false
    end
    if (parameters[1].__cname == FighterBuff.__cname) then
        trigger = (parameters[1]).source
    elseif (parameters[1].__cname == Fighter.__cname) then
        trigger = parameters[1];
    else
        return false;
    end
    return buff.source.fighterId == trigger.fighterId;
end
t = ADD_VALUE("condition31", 31, "职业要求")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local target = buff.target
    for i = 2, #conditionParameters do
        if (conditionParameters[i] == target.heroBean.f_HeroType) then
            return true
        end
    end
    return false
end
t = ADD_VALUE("condition32", 32, "替补判断")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    return buff.target.assistant
end
t = ADD_VALUE("condition33", 33, "是否为前排或后排单位")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    return buff.target:isFrontRow()
end
t = ADD_VALUE("condition34", 34, "生命值高于")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local target = buff.target
    return (target.hp + 0.0) / FighterAttributeManager.getFightAttr(target, FighterAttributeEnum.HP) >= Utils.toRatio(conditionParameters[2]);
end
t = ADD_VALUE("condition35", 35, "造成伤害")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (#parameters < 3) then
        return false;
    end
    if (not (parameters[3].__cname == FightResult.__cname)) then
        return false;
    end
    ---@type FightResult
    local result = parameters[3]
    if (result.damage <= 0) then
        return false;
    end

    return result.state == DamageResultTypeEnum.NORMAL or result.state == DamageResultTypeEnum.CRIT
end
t = ADD_VALUE("condition36", 36, "概率")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local random = buff.source.fight:random(Global.TEN_THOUSANDTH);
    return random <= conditionParameters[2]
end
t = ADD_VALUE("condition37", 37, "受到暴击伤害")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local source = buff.source
    ---@type  Fighter
    local target = parameters[1];
    if (conditionParameters[2] == 0) then
        if (source ~= target) then
            return false;
        end
    elseif (conditionParameters[2] == 1) then
        if (source == target) then
            return false;
        end
    end
    ---@type FightResult
    local result = parameters[3];
    if (result.damage <= 0) then
        return false;
    end

    return result.state == DamageResultTypeEnum.CRIT
end
t = ADD_VALUE("condition38", 38, "队友身上有指定buff")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type Fighter
    local target;
    if (conditionParameters[2] == 1) then
        target = buff.target
    elseif (conditionParameters[2] == 2) then
        target = parameters[1]
    else
        return false;
    end
    if (#conditionParameters < 3) then
        return false;
    end

    local buffOther = BuffManager.getBuffByModel(target, conditionParameters[3]);
    return buffOther ~= nil
end
t = ADD_VALUE("condition40", 40, "没有在移动")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local source = buff.target
    local moveActions = source.moveAction
    return moveActions == nil or table.getn(moveActions)
end
t = ADD_VALUE("condition43", 43, "当前技能没有触发执行过此buff")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FightUsingSkill
    local skill = parameters[2];
    local key = "SKILL_TRIGGER_BUFF_" .. buff.target.fighterId .. "_" .. buff.modelId
    if (skill.parameters[key]) then
        return false;
    end
    skill.parameters[key] = true
    return true;
end
t = ADD_VALUE("condition44", 44, "面/背 向施法者")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local source = buff.source --//施法者
    local taget = buff.target--//buff拥有者
    local leftOrRight = FighterUtils.leftOrRight1(source, taget)--//A --> B
    local currDirection = FighterUtils.getCurrDirection(taget)-- // B--> C
    if (#conditionParameters < 2) then
        return false;
    end
    local conditionParameter = conditionParameters[2]--//1=面对我方  2=背对我方  （以施法者为判断依据）
    if (conditionParameter == 1) then
        return leftOrRight ~= currDirection--//2个人朝向不同, 即是相对
    end
    if (conditionParameter == 2) then
        return leftOrRight == currDirection --//2个人朝向相同  即是相向 (也就是B 背向A)
    end
    return false;
end
t = ADD_VALUE("condition45", 45, "近战or远程")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local taget = buff.target --//buff拥有者
    if (#conditionParameters > 1) then
        if (conditionParameters[2] == 2) then
            taget = parameters[1][1];
        end
    end
    return not taget:isRangedCLass();
end
t = ADD_VALUE("condition46", 46, "上阵职业数量")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local taget = buff.target --//buff拥有者
    local fight = taget.fight
    local fighters = fight.teams[taget.teamIndex].fighters
    local sum = 0;
    for k, fighter in pairs(fighters) do
        local continue = false

        if (fighter.summons) then
            continue = true
        end
        if (not continue and fighter.heroBean.f_HeroType == conditionParameters[2]) then
            sum = sum + 1
        end
    end
    local alternates = fight.teams[taget.teamIndex].alternates
    for k, alternate in pairs(alternates) do
        local continue = false
        if (alternate.summons) then
            continue = true
        end
        if not continue and (alternate.heroBean.f_HeroType == conditionParameters[2]) then
            sum = sum + 1
        end
    end
    return sum < conditionParameters[3];
end
t = ADD_VALUE("condition47", 47, "施法者范围")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local shapType = conditionParameters[2]--//形状 1=身前,2=身后,3=圆
    local x = conditionParameters[3]--x 有多长, 如果为圆,表示半径
    local y = 0;
    if (#conditionParameters > 3) then
        y = conditionParameters[4]--y有多宽, 实际计算为 中心点 +- y/2
    end
    ---@type Fighter
    local source = buff.source
    ---@type Fighter
    local target = buff.target
    if (source == target) then
        return true;
    end
    if (shapType == 3) then
        return DistanceUtil.countDistance(source.position, target.position) <= Utils.toRatio(x)
    end
    local yDis = Utils.toRatio(y) / 2;
    if (target.position.y < source.position.y - yDis or target.position.y > source.position.y + yDis) then
        return false;
    end
    local currDirection = FighterUtils.getCurrDirection(source);--当前的朝向
    if (shapType == 2) then
        currDirection = currDirection * -1;
    end
    local targetX = target.position.x
    local sourceX = source.position.x
    local xPos = sourceX + Utils.toRatio(x) * currDirection;
    local minX = math.min(sourceX, xPos);
    local maxX = math.max(sourceX, xPos);
    return minX <= targetX and targetX <= maxX;
end
t = ADD_VALUE("condition48", 48, "终极技能")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (#parameters < 2) then
        return false;
    end
    if (not (parameters[2].__cname == FightUsingSkill.__cname)) then
        return false;
    end
    local is = false;
    ---@type FightUsingSkill
    local skill = parameters[2]
    if (skill.parentSkill ~= nil) then
        local fightSkill = skill.parentSkill.skill
        if (fightSkill ~= nil and fightSkill.skillType == 1) then
            is = true;
        end
    end
    return is or skill.skill.skillType == 1--//1就是终极技能
end
t = ADD_VALUE("condition49", 49, "带护盾值")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (#parameters < 1) then
        return false;
    end
    if (not (parameters[1].__cname == FighterBuff.__cname)) then
        return false;
    end
    ---@type FighterBuff
    local triggerBuff = parameters[1];
    if (triggerBuff.pool.type ~= BuffPoolEnum.DEFEAT) then
        return false;
    end
    return triggerBuff.pool.current > 0;
end
t = ADD_VALUE("condition50", 50, "带护盾值")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type Fighter
    local target = nil;
    if (conditionParameters[2] == 1) then
        target = buff.target
    elseif (conditionParameters[2] == 2) then
        if (#parameters < 1) then
            return false;
        end
        if (not (parameters[1].__cname == Fighter.__cname)) then
            return false;
        end
        target = parameters[1]
    else
        return false;
    end
    return target.defeatPool > 0;
end
t = ADD_VALUE("condition51", 51, "伤害类型")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (#parameters < 3) then
        return false;
    end
    if (not (parameters[3].__cname == FightResult.__cname)) then
        return false;
    end
    ---@type FightResult
    local result = parameters[3]
    for i = 1, table.getn(conditionParameters) do
        if (result.damageType == conditionParameters[i]) then
            return true;
        end
    end
    return false;
end
t = ADD_VALUE("condition52", 52, "能量变更")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (#parameters < 4) then
        return false;
    end
    if (not (parameters[4].__cname == EnergyChangeReasonEnum.__cname)) then
        return false
    end
    if (not (parameters[3].__cname == FightResult.__cname)) then
        return false;
    end
    -- EnergyChangeReasonEnum
    local season = parameters[4];
    if (conditionParameters[2] ~= 0) then
        if (conditionParameters[2] ~= season) then
            return false;
        end
    end
    ---@type FightResult
    local result = parameters[3]
    if (conditionParameters[3] == 0) then
        return result.damage < 0;
    else
        return result.damage > 0;
    end
end
t = ADD_VALUE("condition52", 52, "能量变更")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (#parameters < 4) then
        return false;
    end
    if ( not  checkClass(parameters[4], EnergyChangeReasonEnum.__cname)) then
        return false
    end
    if (not checkClass(parameters[3],FightResult.__cname)) then
        return false;
    end
    -- EnergyChangeReasonEnum
    local season = parameters[4];
    if (conditionParameters[2] ~= 0) then
        if (conditionParameters[2] ~= season) then
            return false;
        end
    end
    ---@type FightResult
    local result = parameters[3]
    if (conditionParameters[3] == 0) then
        return result.damage < 0;
    else
        return result.damage > 0;
    end
end
t = ADD_VALUE("condition53", 53, "子弹攻击")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local skill = parameters[2];
    local skillBean = skill.skill.skillBean
    return skillBean.f_BulletTpye == 1;
end
--- buff目标身上有指定标记
t = ADD_VALUE("condition54", 54, "子弹攻击")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local src = conditionParameters[2];
    ---@type Fighter
    local fighter;
    if (src == 1) then
        fighter = buff.source
    elseif (src == 2) then
        fighter = buff.target
    else
        if (parameters[1].__cname == Fighter.__cname) then
            fighter = parameters[1]
        else
            if (conditionParameters[1] < 0) then
                return true;
            end
            return false;
        end
    end
    return fighter.totalSign.signs[conditionParameters[3]]
end
---技能的触发方式为 X (对应技能表的 f_TriggerType)
t = ADD_VALUE("condition55", 55, "主动触发的技能")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local skill = parameters[2];
    local skillBean = skill.skill.skillBean
    return skillBean.f_TriggerType == conditionParameters[2];
end
---技能的是怎么放出来的(1=战斗单位主动释放,2=通过技能触发/buff触发/各种触发释放出来的
t = ADD_VALUE("condition56", 56, "主动触发的技能")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    local skill = parameters[2];
    if (conditionParameters[2] == 1) then
        return skill.parentSkill == skill;--没爸爸, 表示是主动释放出来的
    else
        return skill.parentSkill ~= skill;--有爸爸, 表示是通过其他方式触发的
    end
end
t = ADD_VALUE("condition57", 57, "触发次数(每次进入触发时机的次数 在第几次可以通过)")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    for i = 2, 10 do
        if (i < #conditionParameters) then
            if (buff.inTriggerTimes == conditionParameters[i]) then
                return true;
            end
        end
    end
    return false;
end
t = ADD_VALUE("condition58", 58, "是分离技能")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type FightUsingSkill
    local skill = parameters[2];
    return skill.separate
end
t = ADD_VALUE("condition59", 59, "是假召唤物")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    ---@type Fighter
    local fighter = nil
    if (conditionParameters[2] == 1) then
        fighter = buff.target
    elseif (conditionParameters[2] == 2) then
        fighter = parameters[1]
    else
        return false;
    end
    --返回true, 表示是假召唤物
    return fighter.summons and not fighter:isRealSummons()
end
t = ADD_VALUE("condition60", 60, "自己或自己主人")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    if (conditionParameters[1] < 0) then
        return true;
    end
    ---@type Fighter
    local source = buff.source;
    ---@type Fighter
    local target = buff.target;
    if (source == target) then
        return true;
    end
    if (not source.summons) then
        return false;
    end
    return source.summonsCreater == buff.target
end
t = ADD_VALUE("condition61", 61, "触发技能ID")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local skill = parameters[2];
    if (skill == nil) then
        return false;
    end
    for i = 2, #conditionParameters do
        if (skill.skill.skillBean.f_SkillID == conditionParameters[i]) then
            return true;
        end
    end
    return false;
end
---公式计算出来的伤害/治疗 (被护盾或任何方式吸收之前的伤害)>0
t = ADD_VALUE("condition62", 62, "触发技能ID")
---@param buff FighterBuff
function t:actionImp(buff, conditionParameters, ...)
    local parameters = { ... }
    if (conditionParameters[1] < 0) then
        return true;
    end
    if (#parameters < 3) then
        return false;
    end
    if (not (parameters[3].__cname == FightResult.__cname)) then
        return false;
    end
    ---@type FightResult
    local result = parameters[3]
    return result.originalDamage > 0;
end

t = ADD_VALUE("condition63",63, "自己或自己的召唤物")
function t:actionImp(buff, conditionParameters, ...)

    if (conditionParameters[1] < 0) then
        return true;
    end
    local source = buff.source;
    local target = buff.target;
    if (source == target) then
        return true;
    end
    if (source:isSummons()) then
        return false;
    end
    return source == buff.target.summonsCreater;
end
t = ADD_VALUE("condition64",64, "自己对位的敌人")
function t:actionImp(buff, conditionParameters, ...)
    local parameters = {...};
    if (parameters == nil or table.getn(parameters) < 1) then
        if (conditionParameters[1] < 0) then
            return true;
        end
        return false;
    end
    if (not parameters[1]) then
        if (conditionParameters[1] < 0) then
            return true;
        end
        return false;
    end
    local attackTarget = parameters[1];
    local target = buff.target;
    if (attackTarget == target) then
        return false;
    end
    return target.site == attackTarget.site;
end
t = ADD_VALUE("condition65",65, "判断自己是不是在敌人身后")
function t:actionImp(buff, conditionParameters, ...)
    local parameters = {...};
    if (parameters == nil or table.getn(parameters) < 1) then
        if (conditionParameters[1] < 0) then
            return true;
        end
        return false;
    end
    if (not parameters[1]) then
        if (conditionParameters[1] < 0) then
            return true;
        end
        return false;
    end
    local attackTarget = parameters[1];
    local me = buff.target;
    if (attackTarget == me) then
        return false;
    end
    local currDirection = FighterUtils.getCurrDirection(attackTarget);
    if (currDirection == Global.RIGHT) then
        return me.position.x < attackTarget.position.x;
    else
        return me.position.x > attackTarget.position.x;
    end
end